<?php
include dirname(__DIR__) . '/inc/header.php';
?>

<script>
const vue = VueInit(<?=json_encode($GLOBALS['config'])?>);
const wxcodeOnUrl = false;
if (window.config.usewx && !wxcodeOnUrl && is_weixin()) {
    jQuery(function() {
        $('table td').html('<h3>请使用浏览器打开！</h3>');
    });
} else {
    vue.el = '#app';
    vue.created = function () {
        const that = this;
        this.ApiPost('/panel', {}).then(function (res) {
            var url = '/panel.html';
            if (wxcodeOnUrl && param.wxcode) {
                url += '?wxcode=' + param.wxcode;
            }
            url += '#/panel/index.html';
            top.location.href = url;
        }, function (res) {
            var url = '/public/login.html';
            if (param.wxcode) {
                url += '?wxcode=' + param.wxcode;
            }
            top.location.href = url;
        });
    };
}
</script>

<style>
body {
    background-color: #ecf0f5;
}
</style>
<span id="app">
<table width="80%" height="100%" align="center">
    <tr align="center">
        <td>
            正在加载中，请稍后...<br />
            <br />
            <table align="center"><tr><td align="left">
            如长时间没加载成功请尝试<br />
            1：使用谷歌浏览器打开<br />
            2：开启360浏览器的极速模式<br />
            3：换用其它浏览器<br />
            4：清除浏览器缓存<br />
            </td></tr></table>
        </td>
    </tr>
</table>
</body>
</html>
</span>

<script>
new Vue(vue);
</script>
